package cn.kgc.controller;

import cn.kgc.pojo.ResumeNews;
import cn.kgc.service.ResumedeliverService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class ResumedeliverController {
    @Reference
    private ResumedeliverService resumedeliverService;

    //根据状态，公司id查询数量
    @RequestMapping("/getCountResume.json")
    @ResponseBody
    public String  getCount(Integer companyId, Integer resultStateId){
        Integer count=resumedeliverService.countByidAndresultStateId(companyId, resultStateId);
        return "{\"count\":"+count+"}";
    }

    //根据状态，公司id查询简历信息
    @RequestMapping("/showResumeById.json")
    @ResponseBody
    public List<ResumeNews> getResume(Integer companyId, Integer resultStateId){
        return resumedeliverService.getResumedeliverById(companyId, resultStateId);
    }

    //修改简历反馈情况
    @RequestMapping("/mianshi.json")
    @ResponseBody
    public Integer mianshi(Integer id, Integer resultStateId){
        Integer count=resumedeliverService.update(id, resultStateId);
        if(count>0){
            return 1;
        }else {
            return -1;
        }
    }
}
